﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EvoSim.NeuralNets;
using EvoSim.Genes;
using System.IO;

namespace EvoSim.NeuralNets.RMP
{
	public class RMP_ChromosomeSettings : NeuralChromosomeSettings
	{
		public double InhibitoryConnectionChance = 0.5;
		public double ConnectionChance = 0.1;

		public bool NewConnectionsCanForm = true;
		public bool ConnectionsCanDie = true;
		public bool NewNeuronsCanForm = false;
		public bool NeuronsCanDie = false;

		protected override void WriteInfo(BinaryWriter w)
		{
			base.WriteInfo(w);

			w.Write(InhibitoryConnectionChance);
			w.Write(ConnectionChance);

			w.Write(NewConnectionsCanForm);
			w.Write(ConnectionsCanDie);
			w.Write(NewNeuronsCanForm);
			w.Write(NeuronsCanDie);
		}

		public override void Load(BinaryReader r, uint id)
		{
			base.Load(r, id);

			InhibitoryConnectionChance = r.ReadDouble();
			ConnectionChance = r.ReadDouble();

			NewConnectionsCanForm = r.ReadBoolean();
			ConnectionsCanDie = r.ReadBoolean();
			NewNeuronsCanForm = r.ReadBoolean();
			NeuronsCanDie = r.ReadBoolean();
		}
	}
}
